package com.example.drools_study.demo2.controller;

import com.example.drools_study.demo2.req.CalculationReq;
import com.example.drools_study.demo2.service.RuleServiceImpl;
import com.example.drools_study.demo2.vo.CalculationVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/rule")
public class RuleController {
    @Autowired
    private RuleServiceImpl ruleService;

    @RequestMapping("/calculate")
    public List<CalculationVo> calculate(@RequestBody CalculationReq req){
        return ruleService.calculate(req);
    }
}

